Predicate Logic

Predicate Logic

Variables in Logic

Problem Statement: How do you translate “For every integer x, x>0”?

Variable: Lowercase symbol that stands for an individual in a collection or set.

Incomplete Statements

Incomplete Statements: Statement containing one or more variables.

Tip: Replace the word “set/domain” with “array/list” if you have a programming background.

Quantifiers, Predicates, Complete Statements

Quantifiers: Phrases that refer to given quantities, indicating how many objects have a certain property.

Predicate: Verbal statement that describes the property of a variable.


Combining the quantifier and predicate, we get a complete statement of the form:

Interpretation Domain

Interpretation Domain: Collection of objects that may be chosen in a given predicate WFF.

Truth Value of Complete Statements

The truth of an expression is based on its interpretation.

Examples for various interpretations of (\forall x) P(x):

Note on Contradiction: If (\forall X) P(x) is true, (\exists X) P(x) cannot be false

Interpretation

An interpretation for an expression involving predicates consists of the following:

n-ary Predicates

Unary Predicates: Predicates involving properties of single variables

Binary, ternary, and n-ary predicates are also possible.

Example: (\forall x)(\exists y) Q(x,y) is a binary predicate. (“For every x there exists a y such that Q(x,y)”)

Predicate Wffs

Predicate Wffs: A well-formed formula in predicate logic.

Free Variable: Variable without a quantifier

Examples: Reading Predicate Wffs

Example Predicate Wff:

Reading the example:

Example Predicate Wff:

Reading the example:

Example Predicate Wff:

Reading the example:

Example: Determine the truth value of the wff

Solution: (\exists x)[\textcolor{red}{x > 0} \land (\forall y)[\textcolor{green}{x>y} \to \textcolor{yellow}{y \le 0}]]

Exercises: Translating Verbal Statements \to Symbolic Form

Translate “Every person is nice” to symbolic form:

Translate “There is a nice person” to symbolic form:

Write symbolic form for “All dogs chase all rabbits”:

Solution: (\forall x)[D(x) \to (\forall y) [ R(y) \to C(x,y)] ]

Another Possible Solution (Deduction Method): (\forall x)(\forall y)[D (x) \land R(y) \to C(x,y)]

Write symbolic form for “Some dogs chase all rabbits”:

Solution: (\exists x)[D(x) \land (\forall y) [R(y) \to C(x,y)]]

Write symbolic form for “Only dogs chase rabbits”:

Rephrase: “For anything that chases rabbits, it has to be a dog”

Solution: (\forall y)(\forall x)[R(y) \land C(x,y) \to D(x)]

Exercises: Translating Verbal Arguments \to Predicate Wffs

Instructions: Rewrite the following statements as predicate wffs using given variables.

Given:

Rewrite:

  1. Q: All students are intelligent
  2. Q: Some intelligent students like music
  3. Q: Everyone who like music is a stupid student
  4. Q: Only intelligent students like music

Given:

Rewrite:

  1. Q: “Only chefs can cook food”
  2. Q: “No chefs can cook food”

Given:

Rewrite:

  1. Q: “Some days are sunny and rainy”
  2. Q: “It is always a sunny day only if it is a rainy day”
  3. Q: “It rained on Monday and Tuesday”

Negating Predicate Wffs

How-to Apply De Morgan to Predicate Wffs:

Example: “Something is fun” (\exists x) is the opposite of “Nothing is fun” (\forall x)

Given:

Negation:

Exercises: Negating Statements

Instructions: Negate the following statements.

Q: “Everybody loves somebody sometime”

Q: “Some pictures are old and faded.”

Q: “All people are tall and thin”

Q: “Some students eat only pizza”

Q: “Only students eat pizza”

Validity

Validity: A predicate wff is valid if it’s intrinsically true.

Propositional Tautologies versus Predicate Validity:

Propositional WffsPredicate Wffs
Truth valuesTrue or false – depends on the truth value of statement lettersTrue, false or neither (if the wff has a free variable)
Intrinsic truthTautology – true for all truth values of its statementsValid wff – true for all interpretations
MethodologyTruth table to determine if it is a tautologyNo algorithm to determine

Examples of Valid and Invalid Predicates:

Exercises: Determining Validity

Instructions: Determine whether the following wffs are true. Domain of x is all real integers.

Q: (\forall x)[L(x) \to (O(x)] where O(x): “x is odd” and L(x): “x < 10”

Q: (\exists y)(\forall x)(x + y = 0)

Q: (\forall x)(\exists y)(x + y = 0)

Exercise: Translating Verbal Statement to Predicate Wff (Complex)

Problem: “Every ambassador speaks only to diplomats, and some ambassadors speak to someone. Therefore, there is a diplomat.”

Answer: (\forall x)(\forall y)[A(x) \land S(x,y) \to D(y)] \land (\exists x) (\exists y)[ A(x) \land S(x,y) ] \to (\exists x)D(x)

Notes:

Predicate Logic

Predicate Logic: Can represent more complicated statements than statement/propositional logic.

Basic approach to proving predicate logic arguments:

  1. Strip quantifiers (using new inference rules)
  2. Manipulate the unquantified wffs (like statement logic)
  3. Reinsert the quantifiers (using new inference rules)

Predicate Logic Inference Rules

FromCan DeriveNameRestrictions
(\forall x)P(x)P(t) where t is a variable or constant symbolUniversal Instantiation; uiIf t is a variable, it must not fall in the scope of a quantifier for t
(\exists x)P(x)P(t) where g is a variable or constant symbol not previous used in a proof sequenceExistential Instantiation; eiMust be the first rule used that introduces t
P(x)(\forall x)P(x)Universal Generalization; ugP(x) hasn’t been deduced by existential instantiation from any wff in which x is a free variable
P(x) or P(a)(\exists x)P(x)Existential Generalization; egTo go from P(a) to (\exists x)P(x), x mustn’t appear in P(a)

Notes:

Exercises: Proving Predicate Logic Arguments

Instructions: Prove the following arguments

Problem: “All flowers are plants. Sunflower is flower. Therefore, sunflower is a plant.”

Translation: (\forall x)[P(x) \to Q(x)] \land [P(a) \to Q(a)]

Proof Sequence:

  1. (\forall x)[P(x) \to Q(x)]; hypothesis
  2. P(a); hypothesis
  3. P(a) \to Q(a); 1, universal instantiation
  4. Q(a); 2,3 modus ponens

Problem: (\forall x)[P(x) \to Q(x)] \land [Q(y)]' \to [P(y)]'

Proof Sequence:

  1. (\forall x)[P(x) \to Q(x)]; hypothesis
  2. [Q(y)]'; hypothesis
  3. P(y) \to Q(y); 1, universal instantiation
  4. [P(y)]'; 2,3 modus tollens

Problem: (\forall x)P(x) \to (\exists x)P(x)

Proof Sequence:

  1. (\forall x)P(x); hyp
  2. P(x); 1, universal instantiation
  3. (\exists x)P(x); existential generalization

Problem: (\forall x)[P(x) \land Q(x)] \to (\forall x)P(x) \land (\forall x)Q(x)

Proof Sequence:

  1. (\forall x)[P(x) \land Q(x)]; hyp
  2. P(x) \land Q(x); 1, universal generalization
  3. P(x); 2, simplification
  4. Q(x); 2, simplification
  5. (\forall x)P(x); 3, universal generalization
  6. (\forall x)Q(x); 4, universal generalization
  7. (\forall x)P(x) \land (\forall x)Q(x); 5,6 conjunction